package cn.qdhlm.collectservice.common;

/**
 * @Name: Constant
 * @Description: 全局常量
 * @Author: jiangcs
 **/
public class Constant {
    public static final String ROCKETMQ_TOPIC_DEVICEDATA = "DeviceData";
    public static final String ROCKETMQ_TOPIC_TERMINALDATA = "TerminalData";
    public static final String ROCKETMQ_TOPIC_ONLINEDATA = "OnlineData";
    public static final String ROCKETMQ_TOPIC_COMMAND = "Command";
    public static final String ROCKETMQ_TOPIC_DEVICECOMMAND = "DeviceCommand";
    public static final String ROCKETMQ_TAG = "nb-mqtt";
    /**
     * 默认 授权验证：测试环境使用
     */
    public static final String AUTHORIZATION_DEFAULT = "qdhlm";

    /**
     * redis：persistence
     */
    public static final String REDIS_PERSISTENCE_NB_MQTT_DATA = "persistenceNBMqttData";

    /**
     * 终端层级
     */
    public static final int TERMINAL_LEVEL_HOUSEHOLD = 1;
    public static final int TERMINAL_LEVEL_SUMMARY = 2;

    /**
     * 终端类型：2-热表；5-阀门；6-表阀一体；7-测量点
     */
    public static final int TERMINAL_TYPE_METER = 2;
    public static final int TERMINAL_TYPE_VALVE = 5;
    public static final int TERMINAL_TYPE_METER_VALVE = 6;
    public static final int TERMINAL_TYPE_MEASURE_POINT = 7;

    /**
     * 终端接入方式：2-NB_IOT_MQTT
     */
    public static final int TERMINAL_JOIN_MODE_NB_IOT_MQTT = 2;

    /**
     * 故障指标类型：1-预设；2-自定义；3-固化
     */
    public static final int FAULT_INDEX_TYPE_PRESET = 1;
    public static final int FAULT_INDEX_TYPE_CUSTOM = 2;
    public static final int FAULT_INDEX_TYPE_SOLIDIFY = 3;

    public static final int LENGTH_ICCID = 20;
    public static final int LENGTH_COLLECTOR_NO = 10;
    public static final int LENGTH_TERMINAL_MAC_ADDR = 14;
    public static final int LENGTH_TERMINAL_MAC_ADDR_MODBUS = 2;

    public static final int BYTE_LENGTH_ICCID = 20;
    public static final int BYTE_LENGTH_IMEI = 15;
    public static final int BYTE_LENGTH_MODULE_MODEL = 15;
    public static final int BYTE_LENGTH_IP = 32;
    public static final int BYTE_LENGTH_MAC_ADDR = 4;
    public static final int BYTE_LENGTH_FACTORY = 3;
    public static final int BYTE_LENGTH_TERMINAL_MODEL = 20;

    public static final long SN_MAX_COMMAND = 256L;
    public static final long SN_MAX_CONTROL = 99999999L;

    public static final String PROTOCOL_PREFIX_MODBUS = "modbus";

    public static final String SYMBOL_FE = "FE";
    public static final String SYMBOL_68 = "68";
    public static final String SYMBOL_16 = "16";
    public static final String SYMBOL_00 = "00";

    /**
     * 阀门调节模式：0-面板控制；1-远程控制开度；2-回水温度控制开度；3-进回水温差控制开度
     */
    public static final int VALVE_ADJUST_MODE_0 = 0;
    public static final int VALVE_ADJUST_MODE_1 = 1;
    public static final int VALVE_ADJUST_MODE_2 = 2;
    public static final int VALVE_ADJUST_MODE_3 = 3;

    /**
     * 命令执行状态：1-执行中；2-执行成功
     */
    public static final int COMMAND_STATUS_1 = 1;
    public static final int COMMAND_STATUS_2 = 2;

    /**
     * 休眠命令
     */
    public static final String FUNC_CODE_SLEEP = "0c/2";

    /**
     * 固化客户名称
     */
    public static final String CUSTOMER_FENG_TAI = "中自沣泰";
    public static final String CUSTOMER_ZHAO_HONG = "天津兆鸿自动化";
    public static final String CUSTOMER_QI_NENG = "吉林省起能工控";
    /**
     * 默认 授权验证：测试环境使用
     */

    /**
     * redis：persistence
     */
    public static final String REDIS_PERSISTENCE_MQTT_ONLINE = "persistenceMqttOnline";
    public static final String REDIS_PERSISTENCE_MQTT_DATA = "persistenceMqttData";

    /**
     * 日期格式
     */
    public static final String DATE_FORMAT_MONTH_DAY = "MM-dd";
    public static final String DATE_FORMAT_YEAR = "yyyy";

    /**
     * 年起止
     */
    public static final String YEAR_START = "01-01";
    public static final String YEAR_END = "12-31";

    /**
     * 采暖季间隔日期
     */
    public static final String HEATING_SEASON_DATE = "09-30";

    /**
     * 终端层级
     */

    /**
     * 终端类型：2-热表；5-阀门；6-表阀一体；7-测量点
     */

    /**
     * 采集器类型：
     * 1-智能采集器
     */
    public static final int COLLECTOR_TYPE_INTELLIGENT = 1;

    /**
     * 采集器型号：
     * 0-MDC500
     */
    public static final int COLLECTOR_MODEL_MDC500 = 0;

    /**
     * 故障指标类型：1-预设；2-自定义；3-固化
     */

    /**
     * 缴费方式：0-预付款
     */
    public static final int CHARGE_WAY_PREPAY = 0;

    public static final int BYTE_LENGTH_TERMINAL_NO = 16;
    public static final int BYTE_LENGTH_VERSION = 7;
    public static final int BYTE_LENGTH_MIN_PACKAGE = 2;


    public static final String SYMBOL_80 = "80";

    public static final String AFN_02 = "02";
    public static final String AFN_0C = "0c";
    public static final String AFN_0D = "0d";

    public static final int DA_0 = 0;
    public static final int DT_256 = 256;
    public static final int DT_258 = 258;
    public static final int DT_260 = 260;
    public static final int DT_512 = 512;
    public static final int DT_513 = 513;
    public static final int DT_514 = 514;
    public static final int DT_515 = 515;
    public static final int DT_516 = 516;
    public static final int DT_1024 = 1024;
    public static final int DT_1025 = 1025;
    public static final int DT_1026 = 1026;
    public static final int DT_1027 = 1027;
    public static final int DT_1028 = 1028;
    public static final int DT_2048 = 2048;
    public static final int DT_2049 = 2049;
    public static final int DT_2050 = 2050;
    public static final int DT_2051 = 2051;
    public static final int DT_2052 = 2052;
    public static final int DT_4096 = 4096;
    public static final int DT_4097 = 4097;
    public static final int DT_4098 = 4098;
    public static final int DT_4099 = 4099;
    public static final int DT_4100 = 4100;
    public static final int DT_8192 = 8192;
    public static final int DT_8194 = 8194;
    public static final int DT_8195 = 8195;
    public static final int DT_8196 = 8196;
    public static final int DT_16384 = 16384;
    public static final int DT_16385 = 16385;
    public static final int DT_16387 = 16387;
    public static final int DT_16388 = 16388;
    public static final int DT_32768 = 32768;
    public static final int DT_32769 = 32769;
    public static final int DT_32770 = 32770;
    public static final int DT_32771 = 32771;

    /**
     * 采集器状态
     */
    public static final int COLLECTOR_STATUS_0 = 0;
    public static final int COLLECTOR_STATUS_2 = 2;
    public static final int COLLECTOR_STATUS_3 = 3;

    /**
     * 采集器在线记录类型
     */
    public static final int COLLECTOR_ONLINE_TYPE_REG = 1;
    public static final int COLLECTOR_ONLINE_TYPE_HEART = 2;
    public static final int COLLECTOR_ONLINE_TYPE_DATA = 3;
    public static final int COLLECTOR_ONLINE_TYPE_OPERATE_PARAM = 4;

    /**
     * 阀门调节模式
     */

    /**
     * 命令结果等待次数
     */
    public static final int COMMAND_WAIT_TIMES = 5;

    /**
     * 命令执行状态：1-执行中；2-执行成功；3-执行失败
     */
    public static final int COMMAND_STATUS_3 = 3;

    /**
     * 确认包
     */
    public static final String FUNC_CODE_CONFIRM = "00/f3";

    /**
     * 客户： 北明天时
     */
    public static final String CUSTOMER_BEI_MING = "北明天时";
    public static final String ROCKETMQ_TOPIC_NBISON = "nb-is-on";
}
